#include <stdio.h>

unsigned combine(unsigned, unsigned);

int main()
{
	unsigned m, n;
	printf("n = ");
	scanf("%u", &n);
	printf("m = ");
	scanf("%u", &m);
	printf("C(%u,%u) = %u\n", n, m, combine(n, m));
	return 0;
}

unsigned permutate(unsigned n, unsigned m)
{
	if (m > n)
		return 0;

	unsigned result = 1;
	for (; m > 0; --m, --n)
		result *= n;
	return result;
}

unsigned factorial(unsigned n)
{
	unsigned result = 1;
	for (; n > 1; --n)
		result *= n;
	return result;
}

unsigned combine(unsigned n, unsigned m)
{
	return permutate(n, m) / factorial(m);
}
